#include<iostream>
#include<unistd.h>
#include<thread>

__thread int text = 1000;

// 来看看Cpp语言级的线程库
void  handler()
{
    while(1)
    {
        std::cout << "text = " << text<< std::endl;
        text--;
        sleep(1);
    }
}



int main()
{
    std::thread threads(handler);
   
    while(1)
    {
        std::cout << "text = " << text << std::endl;
        sleep(1);
        text--;
    }

    threads.join();

    return 0;
}